
let showConfirm = function (msg, callback) {
  swal({
    title: msg,
    type: 'warning',
    showCancelButton: true,
    confirmButtonColor: '#DD6B55',
    confirmButtonText: '是的，确定',
    closeOnConfirm: false
  }, function () {
    if (callback) {
      callback()
      swal.close()
    }
  })
}
let showMsg = function (msg) {
  swal({
    text: msg
  })
}
let showSuccess = function (msg, callback) {
  swal({
    text: msg,
    type: 'success'
  })
}
let showError = function (msg, callback) {
  swal({
    title: '出错了',
    text: msg,
    type: 'error',
    showCancelButton: true,
    confirmButtonColor: '#DD6B55'
  })
}
export default {
  showConfirm,
  showMsg,
  showSuccess,
  showError
}
